<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
</head>
<body>
	<script type="text/javascript">
		class Div{};

		console.dir(Div);//如果没有计constructor，会默认添加
		new Div();
		//生成实例的时候一定要加new 不然报错。
		
		class Bear{
			constructor(){
				this.name = '熊大';
			}

			sleep(){
				this.name = '熊二';
				console.log('${this.name}爱睡觉');
			}

			static gohome(){
				console.log('${this.name}加载森林');
			}
		}

		const b1 = new Bear();
		console.dir(b1.name);
		//console.log(Bear.name);
		b1.sleep();
		Bear.gohome();
		//b1.gohome();
		console.dir(Bear);

		class xiaoBear extends Bear{
			constructor(){
				super();
			}
		}

		xiaoBear.gohome();
	</script>
</body>
</html>